/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: Dec 31, 2009
 * Time: 10:40:15 AM
 * To change this template use File | Settings | File Templates.
 */
import dk.brics.automaton.Automaton;
import java.util.*;
import org.jdom.Attribute;
import org.jdom.Element;

// Referenced classes of package dk.brics.dsd:
//            AttributeDeclaration, RequiredDeclaration, ContentsDeclaration, InternalSchemaErrorException,
//            Schema, Context

abstract class Declaration
{

    Declaration()
    {
    }

    abstract Element toXML(Context context);

    static List parseList(Element element, Schema schema)
    {
        ArrayList arraylist = new ArrayList();
        Iterator iterator = element.getChildren().iterator();
        do
        {
            if(!iterator.hasNext())
                break;
            Element element1 = (Element)iterator.next();
            if(Schema.isDSDElement(element1))
                arraylist.add(parse(element1, schema));
        } while(true);
        return arraylist;
    }

    static Declaration parse(Element element, Schema schema)
    {
        String s = element.getName();
        Object obj;
        if(s.equals("attribute"))
            obj = new AttributeDeclaration(element, schema);
        else
        if(s.equals("required"))
            obj = new RequiredDeclaration(element, schema);
        else
        if(s.equals("contents"))
            obj = new ContentsDeclaration(element, schema);
        else
            throw new InternalSchemaErrorException();
        return ((Declaration) (obj));
    }

    boolean attributeMatch(Attribute attribute, Context context)
    {
        return false;
    }

    boolean attributeNameMatch(Attribute attribute, Context context)
    {
        return false;
    }

    Automaton addAttributeLabels(String s, Context context, Automaton automaton)
    {
        return automaton;
    }

    void checkRequirements(Context context, Set set)
    {
    }

    void findDeclarations(List list)
    {
    }

    void collectAttributeNormalization(Context context, Map map, Map map1, Map map2, Map map3)
    {
    }

    List getDefaultContents()
    {
        return null;
    }

    String getContentsWhitespace()
    {
        return null;
    }

    String getContentsCase()
    {
        return null;
    }
}
